<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <title>List of hotels</title>
        </head>
        <body>
            <h1>List of hotels</h1>
            
            
            <h:form id="listOfHotels">
                <t:dataTable value="#{hotelManager.hotels}" var="hotel" rendered="#{not empty hotelManager.hotels}" styleClass="list" rowClasses="row0,row1">
                    <t:column>
                        <f:facet name="header">Id</f:facet>
                        <h:outputText value="#{hotel.id}"/>
                    </t:column>
                    <t:column>
                        <f:facet name="header">Name</f:facet>
                        <h:outputText value="#{hotel.name}"/>
                    </t:column>
                    <t:column>
                        <f:facet name="header">Description</f:facet>
                        <h:outputText value="#{hotel.description}"/>
                    </t:column>
                    <t:column headercolspan="3">
                        <f:facet name="header">Action</f:facet>
                        <h:commandLink action="#{hotelManager.edit}" value="Edit">
                            <f:param name="hotelId" value="#{hotel.id}"/>
                        </h:commandLink>
                    </t:column>
                    
                    <t:column>
                        <h:commandLink action="#{hotelManager.editLocale}" value="Edit (polish)">
                            <f:param name="hotelId" value="#{hotel.id}"/>
                            <f:param name="locale" value="pl_PL"/>
                        </h:commandLink>
                    </t:column>
                    
                    <t:column>
                        <h:commandLink action="#{hotelManager.editLocale}" value="Edit (german)">
                            <f:param name="hotelId" value="#{hotel.id}"/>
                            <f:param name="locale" value="de_DE"/>
                        </h:commandLink>
                    </t:column>

                    
                    
                    
                </t:dataTable>
                <h:commandButton id="editButton" action="#{hotelManager.add}" value="Add"/>
            </h:form>
            
            
    
        </body>
    </html>
</f:view>